package com.sdkx.wear_os.ui.activity

import com.gyf.immersionbar.BarHide
import com.gyf.immersionbar.ImmersionBar
import com.sdkx.wear_os.R
import com.sdkx.wear_os.base.BaseActivity
import com.sdkx.wear_os.base.BaseViewModel
import com.sdkx.wear_os.databinding.ActivityPictureBinding
import com.sdkx.wear_os.utils.GlideEngine

/**
 * 图片预览
 */
class PictureActivity : BaseActivity<BaseViewModel, ActivityPictureBinding>() {

    //图片地址
    private var pictureUrl = ""

    override fun initLayout() = R.layout.activity_picture

    override fun initView() {
        //状态栏设置
        ImmersionBar.with(this).hideBar(BarHide.FLAG_HIDE_BAR).init()
        pictureUrl = intent?.getStringExtra("pictureUrl").toString()
        //加载图片
        GlideEngine.createGlideEngine().loadImage(this, pictureUrl, mDataBinding.previewPhotoview)
    }

    override fun initData() {
    }

    override fun initListener() {
        //点击图片销毁
        mDataBinding.previewPhotoview.setOnClickListener { finish() }
    }
}